 <#ftl encoding="UTF-8" />
            <form id="form_data" class="form__data_content">
                <!-- 对账单 -->
                <div id="panelTop" style="position:relative; height:50px; border-bottom: 1px solid #ddd; background-color:#fff;">
                    <div id="btnPanel_01" style="position:absolute; display:inline-block; top:12px; left: 8px; width:auto; padding:0;">
                        <button type="button" name="_ButBack" id="ButBack" class="act__button" onclick="_InstancePageHeader.DoBack();"><i class="fa-all fa-1x fa-reply" style="margin-right:3px;"></i>返回</button>
                        <button type="button" name="_ButNew" id="ButNew" class="act__button" onclick="_InstancePageHeader.New();"><i class="fa-all fa-1x fa-plus" style="margin-right:3px;"></i>增加</button>
                        <button type="button" name="_ButSave" id="ButSave" class="act__button act__save" onclick="_InstancePageHeader.Save();"><i class="fa-all fa-1x fa-save" style="margin-right:3px;"></i>保存</button>
                        <button type="button" name="_ButCheck" id="ButCheck" class="act__button" onclick="_InstancePageHeader.DoCheck();"><i class="fa-all fa-1x fa-eye" style="margin-right:3px;"></i>审核</button>
                        <button type="button" name="_ButUnCheck" id="ButUnCheck" class="act__button" onclick="_InstancePageHeader.Uncheck();"><i class="fa-all fa-1x fa-eraser" style="margin-right:3px;"></i>反审</button>
                        <button type="button" name="_ButPrint" id="ButPrint" class="act__button" onclick="_InstancePageHeader.DoPrintPreview();" style="margin-left:15px;"><i class="fa-all fa-1x fa-print" style="margin-right:3px;"></i>打印预览</button>
                        <button type="button" name="_ButExport" id="ButExport" class="act__button" onclick="_InstancePageHeader.DoExport();"><i class="fa-all fa-1x fa-file-export" style="margin-right:3px;"></i>导出Excel</button>
                    </div>
                    <div id="rec_position" style="position:absolute; display:inline-block; right:80px; top:18px; width:auto;">
                        <span id="rec_cur_row">15</span> / <span id="rec_total_rows">15</span>
                    </div>
                    <div class="panel__toolbar" style="position:absolute; display:inline-block; top:12px; right:20px;">
                        <div class="panel__toolbar_item">
                            <button type="button" class="toolbar__button" name="_ButPrev" id="ButPrev" title="前一条" onclick="_InstancePageHeader.PrevRecord();"><i class="fa-all fa-1x fa-angle-left" style="margin-right:3px;"></i></button>
                        </div>
                        <div class="panel__toolbar_item" disabled="disabled">
                            <button type="button" class="toolbar__button" name="_ButNext" id="ButNext" title="后一条" onclick="_InstancePageHeader.NextRecord();"><i class="fa-all fa-1x fa-angle-right" style="margin-right:3px;"></i></button>
                        </div>
                    </div>
                </div>
                <div class="data__table_wrapper">
                    <table class="data__table">
                        <colgroup>
                            <col style="width: 7%;" />
                            <col style="width: 20%;" />
                            <col style="width: 7%;" />
                            <col style="width: 15%;" />
                            <col style="width: 7%;" />
                            <col style="width: 15%;" />
                            <col style="width: 7%;" />
                            <col />
                        </colgroup>
                        <tbody>
                            <tr>
                                <td class="td__label">
                                    <label for="BillNo">对账单号<em>★</em></label>
                                </td>
                                <td>
                                    <input type="text" id="BillNo" name="_BillNo" value="" tabindex="1" style="width:245px;" />
                                </td>
                                <td class="td__label">
                                    <label for="SupplierName">供应商<em>★</em></label>
                                </td>
                                <td>                       
                                    <input type="hidden" id="SupplierId" name="_SupplierId" tabindex="2" />
                                    <div id="ChoiceSupplier" class="form_input_dropdown_wrapper" style="width:100%;" onclick="_InstancePageHeader.DoChoiceSupplier();">
                                        <input type="text" id="SupplierName" name="_SupplierName" class="select-dropdown with_select_flag" readonly="readonly" style="color:#000;" tabindex="2" />
                                    </div>
                                </td>
                                <td class="td__label">
                                    <label for="YearOfBill">对账年月<em>★</em></label>
                                </td>
                                <td>
                                    <select id="YearOfBill" name="_YearOfBill" tabindex="3" style="width:50px;" onchange="_InstancePageHeader.SetCycleOfBill();">
                                        <#if YearList?exists>
                                        <#list YearList as _year>
                                        <option value="${_year}">${_year}</option>
                                        </#list>
                                        </#if>
                                    </select>（年）
                                    <select id="MonthOfBill" tabindex="4" style="width:35px;" onchange="_InstancePageHeader.SetCycleOfBill();">
                                        <option value="1">1</option>
                                        <option value="2">2</option>
                                        <option value="3">3</option>
                                        <option value="4">4</option>
                                        <option value="5">5</option>
                                        <option value="6">6</option>
                                        <option value="7">7</option>
                                        <option value="8">8</option>
                                        <option value="9">9</option>
                                        <option value="10">10</option>
                                        <option value="11">11</option>
                                        <option value="12">12</option>
                                    </select>（月）
                                </td>
                                <td class="td__label">
                                    <label for="CycleOfBillFrom">对账周期</label>
                                </td>
                                <td>
                                    <input type="text" id="CycleOfBillFrom" name="_CycleOfBillFrom" tabindex="5" style="width:98px;" />
                                    <span style="text-align:center; width:41px; display:inline-block;">（至）</span>
                                    <input type="text" id="CycleOfBillTo" name="_CycleOfBillTo" tabindex="6" style="width:98px;" />
                                </td>
                            </tr>
                            <tr>
                                <td class="td__label" style="vertical-align:top; padding-top:8px;">
                                    <label for="Description">备注</label>
                                </td>
                                <td colspan="7">
                                    <textarea class="area" id="Description" name="_Description" tabindex="7" style="width:100%; height:50px; resize:none;"></textarea>
                                </td>
                            </tr>
                            <tr>
                                <td class="td__label">
                                    <label for="TotalAmount">对账总金额</label>
                                </td>
                                <td>
                                    <input type="text" id="TotalAmount" name="_TotalAmount" tabindex="8" readonly="readonly" />
                                </td>
                                <td class="td__label">
                                    <label for="UpdatedByName">操作情况</label>
                                </td>
                                <td>
                                    <input type="text" id="UpdatedByName" name="_UpdatedByName" tabindex="9" style="width:90px;" readonly="readonly" />
                                    <input type="text" id="UpdatedDate" name="_UpdatedDate" tabindex="10" style="width:90px;" readonly="readonly" />
                                </td>
                                <td class="td__label">
                                    <label for="CheckedByName">审核情况</label>
                                </td>
                                <td colspan="3">
                                    <input type="text" id="CheckedByName" name="_CheckedByName" tabindex="11" style="width:90px;" readonly="readonly" />
                                    <input type="text" id="CheckedDate" name="_CheckedDate" tabindex="12" style="width:90px;" readonly="readonly" />
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </form>

            <input id="Action" type="hidden" value="<#if action?exists>${action}<#else>0</#if>" />
            <input id="HeaderId" type="hidden" value="<#if headerId?exists>${headerId}<#else>0</#if>" />
            
            <!-- 明细部分 -->
            <div id="panelSlave" style="position:relative; top:0;">
                <!-- 折叠标记 -->
                <div id="hPanelSplitter" title="隐藏主表"><i class="fa-all fa-angle-double-up"></i></div>
                <!-- 明细内容 -->
                <ul id="tabPanelHeader" class="tabstrip" style="top:0; width:100%;">
                    <li id="menu_01" class="tabInactive" style="margin-left:25px;">
                        <div>
                            <span class="tab_stretch"><span class="tabtext"><abbr class="ls_01">订单到货对账</abbr></span></span>
                        </div>
                    </li>
                    <li id="menu_02" >
                        <div>
                            <span class="tab_stretch"><span class="tabtext"><abbr class="ls_02">对账单明细</abbr></span></span>
                        </div>
                    </li>
                </ul>
                <div id="tabPanelData" class="tab__wrapper" style="top:0; height:auto;">
                    <!-- 订单到货情况 -->
                    <div id="tab_wrapper_01" class="tab__content" style="padding-top:5px; width:100%; padding:0 8px;">
                        <div id="panel_slave_butbar_01" style="clear:both; position:relative; top:5px; z-index:+1;">
                            <button type="button" name="_ButNewPoLines" id="ButNewPoLines" class="act__button act__save" onclick="_InstancePageLinesPoStockIn.DoAccountPayable(0);">到货对账</button>
                            <button type="button" name="_ButSavePoLines" id="ButSavePoLines" class="act__button act__save" onclick="_InstancePageLinesPoStockIn.DoAccountPayable(1);">强制对账</button>
                            <button type="button" name="_ButDeletePoLines" id="ButDeletePoLines" class="act__button act__save" onclick="_InstancePageLinesPoStockIn.BatchDeleteLines();"><i class="fa-all fa-1x fa-minus" style="margin-right:3px;"></i>批量删除</button>
                            <span id="search_btn_02" class="search__icon" title="搜索" style="cursor:pointer;">
                                <i class="fa fa-search" style="font-size:20px; position:absolute; top:3px; left:265px;"></i>
                            </span>
                        </div>
                        <div id="grid__wrapper_01" style="position:relative; top:10px;">
                            <table style="width:100%;">
                                <tr>
                                    <td style="overflow:hidden; width:817px;">
                                        <div id="divH11" style="overflow:hidden; border:none;">
                                            <table id="tabHeader11" class="layout display" style="width:100%;">
                                                <colgroup>
                                                    <col style="width:21px;" />
                                                    <col style="width:36px;" />
                                                    <col style="width:200px;" />
                                                    <col style="width:70px;" />
                                                    <col style="width:80px;" />
                                                    <col style="width:80px;" />
                                                    <col style="width:70px;" />
                                                    <col style="width:180px;" />
                                                    <col style="width:80px;" />
                                                </colgroup>
                                                <thead>
                                                    <tr>
                                                        <th style="text-align:center;">
                                                            <label class="btn" for="check_all_po_stockin"><input id="check_all_po_stockin" type="checkbox" onclick="_InstancePageLinesPoStockIn.DoCheckAll($(this),'_check_row_01');" /><i></i><span></span></label>
                                                        </th>
                                                        <th style="text-align:center;">删除</th>
                                                        <th>订单合同号</th>
                                                        <th>合同类型</th>
                                                        <th>落单日期</th>
                                                        <th>计划到货日期</th>
                                                        <th>采购担当</th>
                                                        <th>入库单号</th>
                                                        <th>到货日期</th>
                                                    </tr>
                                                </thead>
                                            </table>
                                        </div>
                                    </td>
                                    <td style="position:relative;">
                                        <div id="divH12" class="header__with__margin">
                                            <table id="tabHeader12" class="layout display" style="margin-left:-1px; width:100%;">
                                                <colgroup>
                                                    <col style="width: 300px;" />
                                                    <col style="width: 100px;" />
                                                    <col style="width: 90px;" />
                                                    <col style="width: 90px;" />
                                                    <col style="width: 90px;" />
                                                    <col style="width: 90px;" />
                                                    <col style="width: 90px;" />
                                                    <col style="width: 417px;" />
                                                </colgroup>
                                                <thead>
                                                    <tr>
                                                        <th>款号</th>
                                                        <th>供应商</th>
                                                        <th>验料员</th>
                                                        <th>验料日期</th>
                                                        <th>入库日期</th>
                                                        <th>操作员</th>
                                                        <th>操作日期</th>
                                                        <th>备注</th>
                                                    </tr>
                                                </thead>
                                            </table>
                                        </div>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="vertical-align:top; width:817px;">
                                        <div id="divD11" class="grid__data_wrapper" style="border:none; border-bottom:1px solid #c6c3bd; overflow:hidden;">
                                            <table id="tabData11" class="responsive__table" style="margin-top:-1px;">
                                                <colgroup>
                                                    <col style="width:21px;" />
                                                    <col style="width:36px;" />
                                                    <col style="width:200px;" />
                                                    <col style="width:70px;" />
                                                    <col style="width:80px;" />
                                                    <col style="width:80px;" />
                                                    <col style="width:70px;" />
                                                    <col style="width:180px;" />
                                                    <col style="width:80px;" />
                                                </colgroup>
                                                <tbody>
                                                </tbody>
                                            </table>
                                        </div>
                                    </td>
                                    <td class="with__border__lines" style="vertical-align:top; width:100%;">
                                        <div id="divD12" class="grid__data_wrapper" style="overflow:scroll;" onscroll="_InstancePageLinesPoStockIn.ScrollTo();">
                                            <table id="tabData12" class="responsive__table" style="margin-top:-1px; margin-left:-1px; width:100%;">
                                                <colgroup>
                                                    <col style="width: 300px;" />
                                                    <col style="width: 100px;" />
                                                    <col style="width: 90px;" />
                                                    <col style="width: 90px;" />
                                                    <col style="width: 90px;" />
                                                    <col style="width: 90px;" />
                                                    <col style="width: 90px;" />
                                                    <col style="width: 400px;" />
                                                </colgroup>
                                                <tbody>
                                                </tbody>
                                            </table>
                                        </div>
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </div>
                    <!-- 对账单明细 -->
                    <div id="tab_wrapper_02" class="tab__content" style="padding-top:5px; display:none; padding:0 8px;">
                        <div id="panel_slave_butbar_02" style="clear:both; position:relative; top:5px; z-index:+1;">
                            <button type="button" name="_ButSaveLines" id="ButSaveLines" class="act__button act__save" onclick="_InstancePageLines.SaveLines();"><i class="fa-all fa-1x fa-save" style="margin-right:3px;"></i>保存明细</button>
                            <button type="button" name="_ButUpdateTaxRate" id="ButUpdateTaxRate" class="act__button act__save" onclick="_InstancePageLines.SyncLinesData();">同步更新数据</button>
                        </div>
                        <div id="panel_slave_data_02" style="position:relative; top:10px; width:100%;">
                            <table style="width:100%;">
                                <tr>
                                    <td style="overflow:hidden; width:677px;">
                                        <div id="divH21" style="overflow:hidden; border:none;">
                                            <table id="tabHeader21" class="layout display" style="width:100%;">
                                                <colgroup>
                                                    <col style="width: 21px;" />
                                                    <col style="width: 200px;" />
                                                    <col style="width: 76px;" />
                                                    <col style="width: 180px;" />
                                                    <col style="width: 200px;" />
                                                </colgroup>
                                                <thead>
                                                    <tr>
                                                        <th style="text-align:center;">
                                                            <label class="btn" for="check_all_lines"><input id="check_all_lines" type="checkbox" onclick="_InstancePageLines.DoCheckAll($(this),'_check_row_02');" /><i></i><span></span></label>
                                                        </th>
                                                        <th>订单合同号</th>
                                                        <th>到货日期</th>
                                                        <th>料号</th>
                                                        <th>料名</th>
                                                    </tr>
                                                </thead>
                                            </table>
                                        </div>
                                    </td>
                                    <td>
                                        <div id="divH22" style="overflow:hidden; border-right:1px solid #a8a8a8;">
                                            <table id="tabHeader22" class="layout display" style="margin-left:-1px; border-left:none; width:100%;">
                                                <colgroup>
                                                    <col style="width: 70px;" />
                                                    <col style="width: 70px;" />
                                                    <col style="width: 100px;" />
                                                    <col style="width: 100px;" />
                                                    <col style="width: 35px;" />
                                                    <col style="width: 70px;" />
                                                    <col style="width: 70px;" />
                                                    <col style="width: 70px;" />
                                                    <col style="width: 60px;" />
                                                    <col style="width: 85px;" />
                                                    <col style="width: 90px;" />
                                                    <col style="width: 130px;" />
                                                    <col style="width: 50px;" />
                                                    <col style="width: 65px;" />
                                                    <col style="width: 400px;" />
                                                </colgroup>
                                                <thead>
                                                    <tr>
                                                        <th>实到规格</th>
                                                        <th>系数</th>
                                                        <th>颜色</th>
                                                        <th class="edit__column">缸号</th>
                                                        <th style="text-align:center;">单位</th>
                                                        <th style="text-align:center;">订单数量</th>
                                                        <th style="text-align:center;">入库数量</th>
                                                        <th style="text-align:center;" class="edit__column">对账数量</th>
                                                        <th style="text-align:center;">单价</th>
                                                        <th class="edit__column">不含税单价</th>
                                                        <th class="edit__column">结算金额</th>
                                                        <th class="edit__column">发票号</th>
                                                        <th class="edit__column">税率</th>
                                                        <th class="edit__column">开票日</th>
                                                        <th class="edit__column" style="border-right:none;">备注</th>
                                                    </tr>
                                                </thead>
                                            </table>
                                        </div>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="vertical-align:top; width:677px;">
                                        <div id="divD21" class="grid__data_wrapper" style="border:none; border-bottom:1px solid #c6c3bd; overflow:hidden;">
                                            <table id="tabData21" class="responsive__table" style="margin-top:-1px;">
                                                <colgroup>
                                                    <col style="width: 21px;" />
                                                    <col style="width: 200px;" />
                                                    <col style="width: 76px;" />
                                                    <col style="width: 180px;" />
                                                    <col style="width: 200px;" />
                                                </colgroup>
                                                <tbody>
                                                </tbody>
                                            </table>
                                        </div>
                                    </td>
                                    <td style="vertical-align:top;">
                                        <div id="divD22" class="grid__data_wrapper" onscroll="_InstancePageLines.ScrollTo();">
                                            <table id="tabData22" class="responsive__table" style="border-bottom:1px solid #c6c3bd; margin-top:-1px; margin-left:-1px; width:100%;">
                                                <colgroup>
                                                    <col style="width: 70px;" />
                                                    <col style="width: 70px;" />
                                                    <col style="width: 100px;" />
                                                    <col style="width: 100px;" />
                                                    <col style="width: 35px;" />
                                                    <col style="width: 70px;" />
                                                    <col style="width: 70px;" />
                                                    <col style="width: 70px;" />
                                                    <col style="width: 60px;" />
                                                    <col style="width: 85px;" /> 
                                                    <col style="width: 90px;" />
                                                    <col style="width: 130px;" />
                                                    <col style="width: 50px;" />
                                                    <col style="width: 65px;" />
                                                    <col style="width: 400px;" />
                                                </colgroup>
                                                <tbody>
                                                </tbody>
                                            </table>
                                        </div>
                                    </td>
                                </tr>
                            </table>
                            <div id="wrapper__navbar_02" class="panel__nav_strip">
                                <div style="position:relative; display:inline-block; padding:0px; height:30px; line-height:30px;">
                                    <span id="loading__indicator_02"><i class="fa fa-refresh fa-fw"></i></span>
                                    显示 <select id="page-size_02" onchange="_InstancePageLines.SetPageSize02()">
                                        <option value="10">10</option>
                                        <option value="15">15</option>
                                        <option value="20">20</option>
                                    </select> 条 / 页
                                    <span id="page-first_02" class="p_first arrow page-first" data-action="first">首页</span>
                                    <span id="page-previous_02" class="p_previous arrow page-previous" data-action="previous">上一页</span>
                                    <abbr id="page_indicator_block_02" class="page_indicator_block" _msh_page="1" style="margin:0 10px; width:40px;">1 of 7</abbr>
                                    <span id="page-next_02" class="p_next arrow page-next" data-action="next">下一页</span>
                                    <span id="page-last_02" class="p_last arrow page-last" data-action="last">尾页</span>
                                    <input type="text" id="curr-page_02" class="curr-page" style="margin-left:15px; width:36px;" />
                                    <input type="button" name="btn_goto" id="but_goto_02" value="跳转" class="act__button page-goto" onclick="" />
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <!-- 对订单到货情况进行搜索 -->
            <div id="search_02" class="search">
                <div class="search__modal">
                    <div class="search__content search__form">
                        <div class="search__form_header">
                            <h2>设置搜索条件</h2>
                            <div id="search__form_butclose_02">
                                <span title="关闭">×</span>
                            </div>
                        </div>
                        <form id="form_search_02">
                            <table>
                                <colgroup>
                                    <col style="width: 110px;" />
                                    <col />
                                </colgroup>
                                <tbody>
                                    <tr>
                                        <td class="td__label"><label class="form__label">入库单号</label></td>
                                        <td>
                                            <input type="text" id="StockInBillNoFilterValue_02" name="_StockInBillNoFilterValue_02" style="width:75%;" tabindex="1" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="td__label"><label class="form__label">订单号</label></td>
                                        <td>
                                            <input type="text" id="PoNoFilterValue_02" name="_PoNoFilterValue_02" style="width:75%;" tabindex="2" />
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                            <div id="search-strip_02">
                                <input type="button" name="_but_filter_02" value="搜索" id="but_filter_02" class="act__button" tabindex="3" onclick="_InstancePageLinesPoStockIn.FetchLines(1);"/>
                                <input type="button" name="_but_filter_all_02" value="显示全部" id="but_filter_all_02" class="act__button" tabindex="4" onclick="_InstancePageLinesPoStockIn.FetchLines(0);"/>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
            <div style="display:none; position:absolute; top:-9999px; left:-9999px;">
                <iframe id="export_iframe" name="_export_iframe"></iframe>
                <form action="" name="_exportExcel" id="exportExcel" method="POST" target="export_iframe" accept-charset="utf-8">
                    <input type="hidden" id="Export_HeaderId" name="_Export_HeaderId" value="" />'
                    <input type="hidden" id="Export_StyleNoFlag" name="_Export_StyleNoFlag" value="" />
                </form>
            </div>
